package com.springboot.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author yexi
 */
@Component
public class ComponentClass {

    @PostConstruct
    public void init() {
        System.out.println("@PostConstruct: 依赖注入完成后立即执行的方法");
    }

    @Value("12")
    public void sad(String msg, Integer value) {
        System.out.println("@Value: 依赖注入时就会执行的方法");
        System.out.println("@Value成功赋值: " + msg + "," + value);
    }

}
